﻿@model IEnumerable<MVCTask.Models.Task>
@{
    ViewBag.Title = "(" + Model.Count() + ") Tasks";
    
}
@if (ViewBag.Status == null)
{
    <h2>Showing @Model.Count() tasks</h2>
}
else 
{ 
    <h2>Showing @Model.Count() tasks with status: @ViewBag.Status</h2>
}   
@*@{Html.RenderAction("StatusList", "Status");}*@
<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table id="table">
    <tr>
        <th>
            Description
        </th>
        <th>
            Status
        </th>
        <th>
            Category
        </th>
        <th>
        </th>
    </tr>
    @foreach (var item in Model)
    {
        <tr>
            <td>@Html.DisplayFor(modelItem => item.Description)</td>
            <td>@Html.DisplayFor(modelItem => item.Status.Description)</td>
            <td>@Html.DisplayFor(modelItem => item.Category.Description)</td>
            <td>
                @Html.ActionLink("Edit", "Edit", new { id = item.ID })
            </td>
        </tr>
    }
</table>
